 <?php 

$userid = $_GET['userid'];
//$username='trang';
//$actives = ($_GET['actives']!='false')? "'Active', ": "";
//$pendings = ($_GET['pendings']!='false')? "'Pending', ": "";
//$solds = ($_GET['solds']!='false')? "'Sold'": "";
//
//$in = $actives.$pendings.$solds;
//
//$in = trim($in);
//$in = rtrim($in, ',');
//$in = "(".$in.")";
//echo $in;

include("../db/opendb.php");

include("functions.php");

//$query = "select i.Path as IMAGE, l.OID, l.LISTSTATUS, l.STREETNUM, l.STREETNAME, l.STREETSUFFIX, l.CITY, l.STATE, l.BEDS, l.BATHSTOTAL, l.SQFTTOTAL, l.PARKINGCOVERED, l.LISTPRICE from PROPERTIES l inner join Prop_Owner_Con p on p.Prop_OID = l.OID inner join Users u on u.ID = p.Owner left join Listing_Images i on (i.Listing_ID = l.OID and i.Main_Photo = 1) where u.Username = '".$username."' and l.LISTSTATUS in ".$in." order by l.LISTSTATUS";

$query = "Select c.User_ID, u.ID, u.Email, u.Image, u.Username, u.First_Name,u.Last_Name, u.City, u.State, u.Phone, u.Website, u.Date_Created  from Connections c inner join Users u on u.ID = c.User_ID where c.Owner = '".$userid."' ";

echo $query;

$result = mysql_query($query) or die ("SQL Error".mysql_error());

$xml = getXML($result);

echo $xml;

?>
